//
//  UITapLabel.m
//  easymarketing
//
//  Created by HailongHan on 14/12/30.
//  Copyright (c) 2014年 cubead. All rights reserved.
//

#import "UITapLabel.h"

@interface UITapLabel()

@property (nonatomic, copy) void(^tapActions)(id);

@end

@implementation UITapLabel

- (void)tapActionEvents{
    if (self.tapActions) {
        self.tapActions(self);
    }
}

-(void)addTargetsBlock:(void (^)(id))action{
    self.tapActions = action;
    if (![self gestureRecognizers]) {
        self.userInteractionEnabled = YES;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapActionEvents)];
        [self addGestureRecognizer:tap];
    }
}

@end
